#!/usr/bin/env node

/**
 * 前端测试运行器
 * 运行所有前端单元测试
 */

const routePlannerTests = require('./route-planner.test.js')
const footprintTests = require('./footprint.test.js')

console.log('步语前端单元测试')
console.log('==================\n')

let allPassed = true

// 运行路径规划页面测试
console.log('1. 路径规划页面测试')
console.log('-------------------')
const routePlannerPassed = routePlannerTests.runAllTests()
allPassed = allPassed && routePlannerPassed

console.log('\n')

// 运行足迹页面测试
console.log('2. 足迹页面测试')
console.log('-------------------')
const footprintPassed = footprintTests.runAllTests()
allPassed = allPassed && footprintPassed

console.log('\n==================')
if (allPassed) {
  console.log('✓ 所有前端测试通过')
  process.exit(0)
} else {
  console.log('✗ 部分测试失败')
  process.exit(1)
}
